home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / asmutil / 80x0393.zip / MOUSETUT.FAQ < prev    next >
Text File  |  1993-03-30  |  23KB  |  734 lines

  1.  
  2.                   The Microsoft Mouse Interface Tutorial
  3.                 By Matthew Hildebrand (FidoNet 1:247/128.2)
  4.                         Revision:  January 14, 1993
  5.  
  6.  
  7. Applications wishing to interface to the mouse should do so via calls to
  8. the industry-standard Microsoft or compatible mouse driver.  All calls to
  9. the driver are made through interrupt 33h.
  10.  
  11. A list of answers to frequently asked questions is at the end of this
  12. document.
  13.  
  14. Following is a summary of the functions the mouse driver provides.
  15.  
  16.  
  17.  
  18.  
  19.                      **** MOUSE DRIVER FUNCTIONS ****
  20.  
  21. ==============================
  22. Function 00h:  Reset mouse
  23.  
  24. Call with      AX = 0000h
  25.  
  26. Return         If mouse available
  27.                  AX = FFFFh
  28.                  BX = number of buttons
  29.                If mouse unavailable
  30.                  AX = 0000h
  31.  
  32. Notes          Calling this function will initialize the mouse hardware,
  33.                position the pointer at the screen center, set the pointer
  34.                display page to zero, hide the pointer, reset the pointer
  35.                shape to the default, disable any user-defined event
  36.                handlers, enable light pen emulation, set the horizontal
  37.                mickeys:pixels ratio to 8:8 and the vertical ratio to 16:8,
  38.                set the double speed threshold to 64 mickeys/second, and set
  39.                both the horizontal and vertical maximum and minimum pointer
  40.                bounds to include the entire screen.
  41.  
  42. See also       Function 21h
  43.  
  44.  
  45. ==============================
  46. Function 01h:  Show pointer
  47.  
  48. Call with      AX = 0001h
  49.  
  50. Return         Nothing
  51.  
  52. Notes          Calls to Functions 01h and 02h are cumulative; ie., if
  53.                Function 01h is called twice, Function 02h must be called
  54.                twice before the pointer becomes visible again.
  55. See also       Function 02h
  56.  
  57.  
  58. ==============================
  59. Function 02h:  Hide pointer
  60.  
  61. Call with      AX = 0002h
  62.  
  63. Return         Nothing
  64.  
  65. Notes          Calls to Functions 01h and 02h are cumulative; ie., if
  66.                Function 01h is called twice, Function 02h must be called
  67.                twice before the pointer becomes visible again.
  68.  
  69. See also       Function 01h
  70.  
  71.  
  72. ==============================
  73. Function 03h:  Get pointer position and button status
  74.  
  75. Call with      AX = 0002h
  76.  
  77. Return         BX = button status
  78.                  bit 0   left button down (if set)
  79.                  bit 1   right button down (if set)
  80.                  bit 2   center button down (if set)
  81.                CX = x coordinate
  82.                DX = y coordinate
  83.  
  84. Notes          Coordinates are always in pixels, where (0,0) is the upper-
  85.                left of the screen.
  86.  
  87. See also       Functions 04h-06h
  88.  
  89.  
  90. ==============================
  91. Function 04h:  Set pointer position
  92.  
  93. Call with      AX = 0004h
  94.                CX = x coordinate
  95.                DX = y coordinate
  96.  
  97. Return         Nothing
  98.  
  99. Notes          The new position will be disregarded if it lies within an
  100.                exclusion area.
  101.  
  102.                Coordinates are always in pixels, where (0,0) is the upper-
  103.                left of the screen.
  104.  
  105.                The position will be modified, if necessary, such that it
  106.                lies within the horizontal and vertical limits.
  107.  
  108. See also       Function 03h
  109.  
  110.  
  111. ==============================
  112. Function 05h:  Get button press information
  113.  
  114. Call with      AX = 0005h
  115.                BX = button
  116.                  0 = left button
  117.                  1 = right button
  118.                  2 = center button
  119.  
  120. Return         AX = button status
  121.                  bit 0   left button down (if set)
  122.                  bit 1   right button down (if set)
  123.                  bit 2   center button down (if set)
  124.                BX = button press counter (number since last call)
  125.                CX = x coordinate of last press
  126.                DX = y coordinate of last press
  127.  
  128. Notes          The button press counter for the specified button is reset
  129.                to zero following a call to this function.
  130.  
  131. See also       Function 05h
  132.  
  133.  
  134. ==============================
  135. Function 06h:  Get button release information
  136.  
  137. Call with      AX = 0006h
  138.                BX = button
  139.                  0 = left button
  140.                  1 = right button
  141.                  2 = center button
  142.  
  143. Return         AX = button status
  144.                  bit 0   left button down (if set)
  145.                  bit 1   right button down (if set)
  146.                  bit 2   center button down (if set)
  147.                BX = button release counter (number since last call)
  148.                CX = x coordinate of last release
  149.                DX = y coordinate of last release
  150.  
  151. Notes          The button release counter for the specified button is reset
  152.                to zero following a call to this function.
  153.  
  154. See also       Function 04h
  155.  
  156.  
  157. ==============================
  158. Function 07h:  Set pointer horizontal limits
  159.  
  160. Call with      AX = 0007h
  161.                CX = minimum x coordinate
  162.                DX = maximum x coordinate
  163.  
  164. Return         Nothing
  165.  
  166. Notes          The two values will be swapped if necessary.
  167.  
  168.                If necessary, the pointer will be moved such that it lies
  169.                within the new limits.
  170.  
  171. See also       Functions 08h, 10h
  172.  
  173.  
  174. ==============================
  175. Function 08h:  Set pointer vertical limits
  176.  
  177. Call with      AX = 0008h
  178.                CX = minimum y coordinate
  179.                DX = maximum y coordinate
  180.  
  181. Return         Nothing
  182.  
  183. Notes          The two values will be swapped if necessary.
  184.  
  185.                If necessary, the pointer will be moved such that it lies
  186.                within the new limits.
  187.  
  188. See also       Functions 07h, 10h
  189.  
  190.  
  191. ==============================
  192. Function 09h:  Set graphics pointer shape
  193.  
  194. Call with      AX = 0009h
  195.                BX = hot spot offset from left
  196.                CX = hot spot offset from top
  197.                ES:DX = segment:offset of image buffer
  198.  
  199. Return         Nothing
  200.  
  201. Notes          The hot spot is the pixel of the image which the driver
  202.                considers to be the current position.  For instance, an
  203.                arrow pointer would have its hot spot at the upper left,
  204.                while a crosshairs pointer would have it at the center. 
  205.                Both the horizontal and vertical offsets must be between -16
  206.                and 16 inclusive.
  207.  
  208.                The image buffer's length is 64 bytes.  The first 32 consist
  209.                of a bitmask which is ANDed with the screen image, and the
  210.                second 32 consist of a bitmap which is XORed with the screen
  211.                image.
  212.  
  213. See also       Function 0Ah
  214.  
  215.  
  216. ==============================
  217. Function 0Ah:  Set text pointer type
  218.  
  219. Call with      AX = 000Ah
  220.                BX = pointer type
  221.                  0 = software cursor
  222.                  1 = hardware cursor
  223.                CX = If BX=0:  AND mask
  224.                     If BX=1:  Starting scan line
  225.                DX = If BX=0:  XOR mask
  226.                     If BX=1:  Ending scan line
  227.  
  228. Return         Nothing
  229.  
  230. Notes          If a software cursor is selected, CX and DX are as follows:
  231.                     bits 0-7   character code
  232.                     bits 8-10  foreground colour
  233.                     bit 11     intensity bit
  234.                     bits 12-14 background colour
  235.                     bit 15     blink bit
  236.  
  237.                If the hardware cursor is selected, CX and DX are the
  238.                starting and ending scan lines for the blinking cursor which
  239.                the video card generates, which will depend upon the video
  240.                card used.
  241.  
  242.  
  243. ==============================
  244. Function 0Bh:  Read motion counters
  245.  
  246. Call with      AX = 000Bh
  247.                
  248. Return         CX = net horizontal mickey count
  249.                DX = net vertical mickey count
  250.  
  251. Notes          This function will return the net mouse displacement since
  252.                the last call to this function.  The returned values are
  253.                measured in mickeys, where a negative value is upwards or to
  254.